<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>盒子的浮动</title>
  <style>
    *{
      margin: 0;
      padding:0
    }
    ul{
      list-style: none;
      background-color: #f54343;
      width: 100%;
      height: 36px;
      line-height: 36px;
    }
    li{
      float:left;
      width: 100px;
      color: white;
      text-align: center;
    }
    li:hover{
      background-color: rgb(247, 105, 105);
      cursor:pointer;
    }
    #first{
      margin-left: 80px;
    }
    /*解决浮动塌陷问题的样式类*/
    .clearfix:after{content:'\20';display:block;height:0;clear:both}
    .clearfix{zoom:1}
  </style>
</head>
<body>
<ul class="clearfix">
  <li id="first">资讯</li>
  <li>财经</li>
  <li>科技</li>
  <li>凤凰卫视</li>
  <li>娱乐</li>
  <li>时尚</li>
  <li>军事</li>
  <li>体育</li>
</ul>
</body>
</html>
